<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>家庭成员 - 邦伴用户端</title>
  <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
  <style>
    :root {
      --primary: #ff7e2d;
      --primary-light: #fff3ea;
      --border: #f0f0f0;
      --text-main: #222;
      --text-sub: #888;
    }
    
    body {
      font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
      background-color: #f8f8f8;
      color: var(--text-main);
    }
    
    .app-container {
      width: 375px;
      height: 812px;
      margin: 0 auto;
      background: #fff;
      position: relative;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
      overflow-y: auto;
    }
    
    .primary-color {
      color: var(--primary);
    }
    
    .primary-bg {
      background-color: var(--primary);
    }
    
    .primary-light-bg {
      background-color: var(--primary-light);
    }
    
    .btn-primary {
      background-color: var(--primary);
      color: white;
    }
    
    .btn-outline {
      border: 1px solid var(--primary);
      color: var(--primary);
    }
    
    .member-item {
      border-bottom: 1px solid var(--border);
    }
    
    .member-item:last-child {
      border-bottom: none;
    }
    
    .avatar {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      overflow: hidden;
      background-color: #f3f4f6;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    .avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    
    .tag {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 10px;
      font-size: 10px;
    }
    
    .tag-primary {
      background-color: var(--primary-light);
      color: var(--primary);
    }
    
    .tag-blue {
      background-color: #e6f7ff;
      color: #1890ff;
    }
    
    .tag-green {
      background-color: #e6fff0;
      color: #52c41a;
    }
    
    .tag-purple {
      background-color: #f5e6ff;
      color: #722ed1;
    }
    
    .tag-yellow {
      background-color: #fffbe6;
      color: #faad14;
    }
  </style>
</head>
<body>
  <div class="app-container">
    <!-- 顶部导航栏 -->
    <div class="sticky top-0 z-10 bg-white border-b border-gray-100 px-4 py-3 flex items-center">
      <a href="user_center.html" class="mr-2">
        <i class="fas fa-arrow-left text-lg"></i>
      </a>
      <h1 class="text-lg font-medium flex-1 text-center">家庭成员</h1>
      <a href="#addMemberModal" class="text-sm primary-color">
        <i class="fas fa-plus"></i>
      </a>
    </div>
    
    <!-- 家庭成员列表 -->
    <div class="px-4 py-4">
      <div class="bg-white rounded-lg">
        <div class="member-item p-4">
          <div class="flex items-center">
            <div class="avatar mr-3">
              <img src="https://via.placeholder.com/150" alt="用户头像">
            </div>
            <div class="flex-1">
              <div class="flex items-center">
                <h3 class="font-medium">张先生</h3>
                <span class="tag tag-primary ml-2">本人</span>
              </div>
              <p class="text-xs text-gray-500 mt-1">男 | 44岁 | A型血</p>
            </div>
            <a href="edit_member.html?id=1" class="text-gray-400">
              <i class="fas fa-chevron-right"></i>
            </a>
          </div>
        </div>
        
        <div class="member-item p-4">
          <div class="flex items-center">
            <div class="avatar mr-3">
              <img src="https://via.placeholder.com/150" alt="用户头像">
            </div>
            <div class="flex-1">
              <div class="flex items-center">
                <h3 class="font-medium">李女士</h3>
                <span class="tag tag-blue ml-2">配偶</span>
              </div>
              <p class="text-xs text-gray-500 mt-1">女 | 42岁 | O型血</p>
            </div>
            <a href="edit_member.html?id=2" class="text-gray-400">
              <i class="fas fa-chevron-right"></i>
            </a>
          </div>
        </div>
        
        <div class="member-item p-4">
          <div class="flex items-center">
            <div class="avatar mr-3">
              <img src="https://via.placeholder.com/150" alt="用户头像">
            </div>
            <div class="flex-1">
              <div class="flex items-center">
                <h3 class="font-medium">张小明</h3>
                <span class="tag tag-green ml-2">儿子</span>
              </div>
              <p class="text-xs text-gray-500 mt-1">男 | 15岁 | A型血</p>
            </div>
            <a href="edit_member.html?id=3" class="text-gray-400">
              <i class="fas fa-chevron-right"></i>
            </a>
          </div>
        </div>
        
        <div class="member-item p-4">
          <div class="flex items-center">
            <div class="avatar mr-3">
              <img src="https://via.placeholder.com/150" alt="用户头像">
            </div>
            <div class="flex-1">
              <div class="flex items-center">
                <h3 class="font-medium">张父</h3>
                <span class="tag tag-purple ml-2">父亲</span>
              </div>
              <p class="text-xs text-gray-500 mt-1">男 | 72岁 | AB型血</p>
            </div>
            <a href="edit_member.html?id=4" class="text-gray-400">
              <i class="fas fa-chevron-right"></i>
            </a>
          </div>
        </div>
        
        <div class="member-item p-4">
          <div class="flex items-center">
            <div class="avatar mr-3">
              <img src="https://via.placeholder.com/150" alt="用户头像">
            </div>
            <div class="flex-1">
              <div class="flex items-center">
                <h3 class="font-medium">张母</h3>
                <span class="tag tag-yellow ml-2">母亲</span>
              </div>
              <p class="text-xs text-gray-500 mt-1">女 | 70岁 | A型血</p>
            </div>
            <a href="edit_member.html?id=5" class="text-gray-400">
              <i class="fas fa-chevron-right"></i>
            </a>
          </div>
        </div>
      </div>
      
      <!-- 提示信息 -->
      <div class="mt-4 text-xs text-gray-500 px-2">
        <p>· 添加家庭成员可以更方便地为家人预约服务</p>
        <p>· 可以为家庭成员单独建立健康档案</p>
        <p>· 最多可添加10位家庭成员</p>
      </div>
    </div>
    
    <!-- 添加成员弹窗 -->
    <div class="fixed inset-0 bg-black bg-opacity-50 hidden flex items-center justify-center z-20" id="addMemberModal">
      <div class="bg-white rounded-lg w-80 overflow-hidden">
        <div class="p-4 border-b border-gray-100">
          <h3 class="text-center font-medium">添加家庭成员</h3>
        </div>
        <div class="p-4">
          <div class="mb-4">
            <label class="block text-sm text-gray-600 mb-2">姓名</label>
            <input type="text" class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:border-primary" placeholder="请输入家庭成员姓名">
          </div>
          
          <div class="mb-4">
            <label class="block text-sm text-gray-600 mb-2">关系</label>
            <select class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:border-primary">
              <option value="">请选择与本人关系</option>
              <option value="spouse">配偶</option>
              <option value="son">儿子</option>
              <option value="daughter">女儿</option>
              <option value="father">父亲</option>
              <option value="mother">母亲</option>
              <option value="sibling">兄弟姐妹</option>
              <option value="other">其他</option>
            </select>
          </div>
          
          <div class="mb-4">
            <label class="block text-sm text-gray-600 mb-2">性别</label>
            <div class="flex">
              <label class="flex items-center mr-6">
                <input type="radio" name="gender" value="male" class="mr-1">
                <span>男</span>
              </label>
              <label class="flex items-center">
                <input type="radio" name="gender" value="female" class="mr-1">
                <span>女</span>
              </label>
            </div>
          </div>
          
          <div class="mb-4">
            <label class="block text-sm text-gray-600 mb-2">出生日期</label>
            <input type="date" class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:border-primary">
          </div>
          
          <div class="mb-4">
            <label class="block text-sm text-gray-600 mb-2">手机号码（选填）</label>
            <input type="tel" class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:border-primary" placeholder="请输入手机号码">
          </div>
          
          <div class="mb-4">
            <label class="block text-sm text-gray-600 mb-2">身份证号（选填）</label>
            <input type="text" class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:border-primary" placeholder="请输入身份证号">
          </div>
          
          <div class="flex">
            <button class="flex-1 py-2 border border-gray-300 rounded-lg mr-2" id="cancelAdd">取消</button>
            <button class="flex-1 py-2 btn-primary rounded-lg">确认添加</button>
          </div>
        </div>
      </div>
    </div>
    
    <!-- 删除确认弹窗 -->
    <div class="fixed inset-0 bg-black bg-opacity-50 hidden flex items-center justify-center z-20" id="deleteModal">
      <div class="bg-white rounded-lg w-80 overflow-hidden">
        <div class="p-4 border-b border-gray-100">
          <h3 class="text-center font-medium">删除家庭成员</h3>
        </div>
        <div class="p-4">
          <p class="text-center mb-4">确定要删除该家庭成员吗？</p>
          <div class="flex">
            <button class="flex-1 py-2 border border-gray-300 rounded-lg mr-2" id="cancelDelete">取消</button>
            <button class="flex-1 py-2 bg-red-500 text-white rounded-lg">确认删除</button>
          </div>
        </div>
      </div>
    </div>
  </div>

  <script>
    document.addEventListener('DOMContentLoaded', function() {
      // 添加成员弹窗
      const addLinks = document.querySelectorAll('a[href="#addMemberModal"]');
      const addMemberModal = document.getElementById('addMemberModal');
      const cancelAdd = document.getElementById('cancelAdd');
      
      addLinks.forEach(link => {
        link.addEventListener('click', function(e) {
          e.preventDefault();
          addMemberModal.classList.remove('hidden');
          addMemberModal.classList.add('flex');
        });
      });
      
      cancelAdd.addEventListener('click', function() {
        addMemberModal.classList.add('hidden');
        addMemberModal.classList.remove('flex');
      });
      
      // 点击模态框背景关闭
      document.querySelectorAll('.fixed.inset-0.bg-black.bg-opacity-50').forEach(modal => {
        modal.addEventListener('click', function(e) {
          if (e.target === this) {
            this.classList.add('hidden');
            this.classList.remove('flex');
          }
        });
      });
    });
  </script>
</body>
</html> 